The present invention relates to object-oriented programming, and in particular, to dynamic semantic annotation of objects.
Unless otherwise indicated herein, the approaches described in this section are not prior art to the claims in this application and are not admitted to be prior art by inclusion in this section.
One of the central requirements of system integration is the unambiguous exchange of information, e.g. data objects in object oriented programming. A common way of establishing such an exchange is using semantic annotations of the objects exchanged. Current systems use extensible markup language (XML), or the resource description framework (RDF) combined with the web ontology language (OWL) for integration. While the former does not provide any information about the exchanged objects' semantics, the latter can only be applied if there exists a 1:1 mapping between a class model and an ontology.
More specifically, system integration is a common software engineering task. Ontologies have been proposed for a long time as a means for providing interoperability between systems, as they can serve as an “inter-lingua” and an “interchange format” for information exchange. Practically, this means that exchanged information is annotated with a commonly agreed upon ontology. That is, based on annotations of the systems' class models using a commonly agreed upon ontology (referred to as the T-Box), object instances of those class models can be expressed as exchanged information (referred to as A-box instances) of that ontology, and be transmitted between systems in a semantically unambiguous way.
Since the paradigm of object oriented programming is predominant, information exchange is implemented as an exchange of data objects in most cases. Thus, using semantic annotations for information exchange boils down to annotating data objects.
Annotating objects means providing universally understandable information about the object, e.g. a set of RDF statements, referring to a commonly agreed upon ontology. There are a variety of approaches for producing such annotations, which in most cases statically assign each class in the class model to a corresponding category in the ontology, thus tacitly assuming that a 1:1 mapping between the class model and the ontology exists. Furthermore, those approaches are most often implemented in an intrusive manner, i.e. the class model's implementation needs to be adapted for adding semantic annotations. Three general types of approaches are generative approaches, intrusive approaches and non-intrusive approaches.
In generative approaches, the class model is generated from the ontology with which the objects shall be annotated. Thus, the degree of influence is very high. Generative approaches have a 1:1 mapping between the class model and the ontology.
Generative approaches are an appealing solution when building software from scratch. Once a domain ontology has been captured together with domain experts, e.g. as a part of the specification, it can be used to automatically generate part of the program code (creating an ontology from program code is also possible, although only rarely seen). Besides the savings in development efforts, generative approaches ensure by definition that the ontology and the class model always match perfectly, i.e. a 1:1 mapping between the class model and the ontology exists, and that the ontology and the software do not run out of sync when the ontology is evolving over time (given that the class model is regenerated after each change in the ontology).
Examples for generative approaches are the approach described by Voelkel and Sure in “RDFReactor—From Ontologies to Programmatic Data Access”, the approach described by Kalyanpur, Pastor, Battle and Padget in “Automatic Mapping of OWL Ontologies into Java”, the approach described by Eberhart in “Automatic Generation of Java/SQL Based Ingerence Engines from RDF Schema and RuleML”, and the approach described by Parreiras, Saatho, Walter, Franz and Staab in “APIs à gogo: Automatic Generation of Ontology APIs”. Other examples include the approach described by Oren, Delbru, Gerke, Haller and Decker in “ActiveRDF: Object-Oriented Semantic Web Programming” as applied to Ruby, and the approach described by Swartz in “TRAMP: Makes RDF look like Python Data Structures” as applied to Python.
Intrusive approaches perform changes on the class model's implementation, such as adding special attributes and/or methods to the classes for providing annotations. Intrusive approaches may adapt the class model's implementation for adding semantic annotations.
Intrusive approaches do not generate new Java classes from an ontology, but modify (i.e. intrude into) an existing class model by adding additional code fragments. Examples of intrusive approaches include the approach described by Story in “Sommer—Semantic Object (Metadata) Mapper”, the approach described by Reed in “Semantic Annotation for Persistence”, the approach described by Alishevskikh in “RDFBeans”, the approach described by Wagner, Babi and Bednar in “Java RDF Framework for Knowledge Repository”, and the approach described by Quasthoff and Meinel in “Design Pattern for Object Triple Mapping”. Most of those works are based on the foundation of mapping class models and databases described by Fowler in “Patterns of Enterprise Application Architecture”. Note that all those approaches require a 1:1 mapping between Java classes and concepts in the ontology.
Non-intrusive approaches provide ways to annotate class models without modifying those class models, e.g. by using mappings in a separate file, or by dynamically registering classes with categories in the ontology at run-time. A drawback of non-intrusive approaches is often a larger coding effort (as compared to running a code generator or adding a few Java annotations). Examples of non-intrusive approaches include the ELMO approach described at <www.openrdf.org/doc/elmo/1.5/>, and the approach described by Hillairet, Bertrand and Lafaye in “Bridging EMF applications and RDF data sources”.